<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>使用单打印</title>
<style media="print">
    @page {
      size: auto;  /* auto is the initial value */
      margin: 0mm; /* this affects the margin in the printer settings */
    }
</style>
<style>
* {
	font-size: 14px;
	font-family: 'SimHei','SimSun';
}

body {
	width: 100%;
	margin: 0;
	padding: 0;
}

.wrap {
	padding: 0px 50px 0 50px;
}

.title {
	text-align: center;
	font-size: 1.8em;
	text-align: center;
	margin: 30px 0 8px 0;
}

/* h3 {
	font-size: 1.8em;
	text-align: center;
	margin: 30px 0 8px 0;
} */

table th, table td {
	vertical-align: middle;
}

.form-header, .form-bottom, .vacc-bottom {
	width: 100%;
	margin: 0 auto;
}

.form-bottom, .vacc-bottom {
	margin-bottom: 20px;
}

.form-bottom tr td {
	line-height: 25px;
}

.form-header td {
	width: 50%;
}

.vacc-info, .tran-tool {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	text-align: center;
	margin-bottom: 20px;
}

.vacc-info th, .tran-tool th {
	font-weight: normal;
	/* font-size: 1.2em; */
	padding: 4px;
}

.tran-tool th {
	text-align: left;
}

.vacc-info td, .tran-tool td {
	font-size: 0.8em;
	padding: 4px;
}

.vacc-info-height td, .tran-tool td {
	height: 30px;
}

.underline2, .underline3, .underline4 {
	border-bottom: thin solid #000;
	position: relative;
}

.underline {
	padding: 0 6px;
	display: inline-block;
	width: 170px;
	border-bottom: 1px solid #000;
}
.underline1 {
	padding: 0 6px;
	display: inline-block;
	width: 140px;
	border-bottom: 1px solid #000;
}

th span {
	bottom: -1px;
}

td span {
	margin-right: 4px;
	line-height: 26px;
	bottom: -2px;
}

.mr10 {
	margin-right: 10px;
}

.w30 {
	width: 5%;
	min-width: 5%;
}
.w50 {
	width: 8%;
	min-width: 8%;
}

.w70 {
	width: 12%;
	min-width: 12%;
}

</style>
</head>
<body>
	<div class="wrap">
		<p class = "title">${fns:getUser().office.name }&nbsp;疫苗使用记录表</p>
		<table class="form-header">
			<tr>
				<td style="width: 50%;">出库日期：<fmt:formatDate value="${bsVaccineOrder.outboundDate}" pattern="yyyy年MM月dd日"/> </td>
				<td style="width: 50%;">出库单号:${bsVaccineOrder.orderNo }</td>
			</tr>
			<tr>
				<td colspan = "2">备注信息：${empty bsVaccineOrder.remarks ? '无':bsVaccineOrder.remarks }</td>
			</tr>
		</table>
		<br>
		<c:if test="${not empty list1}">
			<table border="1" class="vacc-info vacc-info-height">
				<tr>
					<th class="w30">序</th>
					<th class="w70">名称</th>
					<th class="w50">生产企业</th>
					<th class="w70">规格</th>
					<th class="w50">批号</th>
					<th class="w70">有效期</th>
					<th class="w30">数量</th>
					<th class="w30">类别</th>
				</tr>
				<c:forEach items="${list1 }" var="li">
					<tr>
						<td>${li.no == 0?'':li.no}</td>
						<td>${li.bsVaccineBatchno.vaccineName }</td>
						<td>${li.bsVaccineBatchno.companyName }</td>
						<c:choose>
							<c:when test="${li.bsVaccineBatchno.batchType eq '2' }">
								<td>${li.bsVaccineBatchno.spec}</td>
							</c:when>
							<c:when test="${li.bsVaccineBatchno.batchType eq '1' }">
								<td>
                                    ${li.bsVaccineBatchno.dose},${li.bsVaccineBatchno.doseType}
                                    ${li.bsVaccineBatchno.spec},${li.bsVaccineBatchno.containerType}
                                </td>
							</c:when>
							<c:otherwise>
								<td></td>
							</c:otherwise>
						</c:choose>
						<td>
							${li.bsVaccineBatchno.batchno}
							<c:if test="${not empty li.bsVaccineBatchno.secondBatchno}">
						        -${li.bsVaccineBatchno.secondBatchno}
						    </c:if>
						</td>
						<td><fmt:formatDate value="${li.bsVaccineBatchno.outBoundDate}" pattern="yyyy年MM月dd日"/></td>
						<td>${li.vaccNum }</td>
						<td>${fns:getDictLabel(li.productType, "bs_vaccineInfo_type", "")}</td>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="6" class="text-right">合计</td>
					<td>${count1 }</td>
					<td>——</td>
				</tr>
			</table>
		</c:if>
		
		<c:if test="${not empty list2}">
			<table border="1" class="vacc-info vacc-info-height">
				<tr>
					<th class="w30">序</th>
					<th class="w70">名称</th>
					<th class="w50">生产企业</th>
					<th class="w70">规格</th>
					<th class="w50">批号</th>
					<th class="w70">有效期</th>
					<th class="w30">数量</th>
					<th class="w30">单价</th>
					<th class="w30">冷链费</th>
					<th class="w30">类别</th>
				</tr>
				<c:forEach items="${list2 }" var="li">
					<tr>
						<td>${li.no == 0?'':li.no}</td>
						<td>${li.bsVaccineBatchno.vaccineName }</td>
						<td>${li.bsVaccineBatchno.companyName }</td>
						<c:choose>
							<c:when test="${li.bsVaccineBatchno.batchType eq '2' }">
								<td>${li.bsVaccineBatchno.spec}</td>
							</c:when>
							<c:when test="${li.bsVaccineBatchno.batchType eq '1' }">
								<td>
                                    ${li.bsVaccineBatchno.dose},${li.bsVaccineBatchno.doseType}
                                    ${li.bsVaccineBatchno.spec},${li.bsVaccineBatchno.containerType}
								</td>
							</c:when>
							<c:otherwise>
								<td></td>
							</c:otherwise>
						</c:choose>
						<td>
							${li.bsVaccineBatchno.batchno}
							<c:if test="${not empty li.bsVaccineBatchno.secondBatchno}">
						        -${li.bsVaccineBatchno.secondBatchno}
						    </c:if>
						</td>
						<td><fmt:formatDate value="${li.bsVaccineBatchno.outBoundDate}" pattern="yyyy年MM月dd日"/></td>
						<td>${li.vaccNum }</td>
						<c:choose>
							<c:when test="${not empty li.vaccNum}">
								<td>￥${li.orignprice}</td>
								<td>${li.coldprice}</td>
							</c:when>
							<c:otherwise>
								<td></td>
								<td></td>
							</c:otherwise>
						</c:choose>
						<td>${fns:getDictLabel(li.productType, "bs_vaccineInfo_type", "")}</td>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="6" class="text-right">合计</td>
					<td>${count2 }</td>
					<td colspan="3">——</td>
				</tr>
			</table>
		</c:if>
		
		<table  class="form-bottom">
			<tr>
				<td style="width: 35%;">制单：<span class="underline">${bsVaccineOrder.createBy.name}&emsp;</span></td>
				<td style="width: 35%;">出库：<span class="underline">${bsVaccineOrder.outerUser.name}&emsp;</span></td>
				<td style="width: 30%;">审批：<span class="underline1">${bsVaccineOrder.auditorUser.name}&emsp;</span></td>
			</tr>
		</table>
	</div>
</body>
<script>
	window.print(); 
	setTimeout("top.opener=null;window.close()",1);
</script>
</html>